import axiosInstance from "./ajax"
import type { ResDataType } from "./ajax"

// 获取性能列表信息
export async function getPerformanceListService(): Promise<ResDataType> {
    const url = "/performance/metrics"
    const data = (await axiosInstance.get(url)) as ResDataType
    return data
}

type SearchOption = {
    path: string
}

// 获取首页性能信息
export async function getFirstPagePerformanceService(params: Partial<SearchOption> = {}): Promise<ResDataType> {
    const url = "/performance/firstpage"
    // params = {path:"123"}
    // {params} = {params:{path:"123"}}
    const data = (await axiosInstance.get(url, { params })) as ResDataType
    return data
}
